<template>
  <div>
    <page-list :x-uri="uri" :custom-components="custom" :doactions="doactions" :checkbox-item="false">
      <!-- 自定义tab -->
      <template v-slot:page-tabs>
        <tabs :tabs="tab" />
      </template>
    </page-list>
    <!-- 审核弹出层 start-->
    <audit-domain-drawer v-if="auditVisible" :visible.sync="auditVisible" :domain-info="currentDomain"></audit-domain-drawer>
    <!-- 审核弹出层 end-->
  </div>
</template>

<script>
import PageList from '@public/template/page_list.vue';
import Tabs from '../tabs/index.vue';
import IsSsl from './components/is_ssl.vue'
// import Status from './components/status.vue'
import Domain from './components/domain.vue'
import AuditDomainDrawer from './components/AuditDomainDrawer'

export default {
  name: 'Domain',
  components: {
    PageList,
    Tabs,
    AuditDomainDrawer
  },
  data() {
    return {
      uri: '/school/admin/domain/list',
      tab: [
        {
          title: '机构域名',
          uri: '/school/domain',
          meta: {
            permission: 'school.domain'
          }
        }
      ],
      doactions: [
        {
          title: '审核',
          meta: { permission: 'school.domain.audit' },
          display({ row }) {
            return row.status === 2
          },
          callback: this.audit
        }
      ],
      custom: {
        is_ssl: IsSsl,
        domain: Domain
        // status: Status
      },
      auditVisible: false,
      currentDomain: {}
    }
  },
  methods: {
    audit({ row }) {
      this.currentDomain = row
      this.auditVisible = true
    }
  }
}

</script>

<style scoped lang="scss">

</style>
